
-- 读写文件
for i = 1, 10, 1 do
    local f = io.open("/T", "wb")
    check_nil(f)
    local data = rtos.buildDate()
    f:write(data)
    f:close()
    f = io.open("/T", "rb")
    check_nil(f)
    check_eq(f:read("a"), data)
    f:close()
end

-- 快捷读写文件
for i = 1, 10, 1 do
    os.remove("/T")
    local data = rtos.buildDate()
    check_nil(io.writeFile("/T", data,"wb"))
    check_eq(io.readFile("/T"),data)
    check_eq(io.fileSize("/T"), #data)
end
